dir='./bash'


function createFile() {
  scriptName=$1
  filenameJs=$1.js
  touch $filenameJs
  echo "const execBash = require('./utils').execBash;" >> $filenameJs
  echo 'execBash(scriptName)' >> $filenameJs
}

echo "Searching in directory" $dir

files=$(ls $dir)
echo $files

cd './bin'
for filename in $files
do
   scriptName=$(echo $filename | sed -E 's/(.*)\.sh/\1/' )
   filenameJs=$scriptName.js
  if [[ ! -f $filenameJs ]]
  then
    touch $filenameJs
    echo "const execBash = require('./utils').execBash;" >> $filenameJs
    echo 'execBash("'"$scriptName"'")' >> $filenameJs
  fi
done
